<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich">

<ui:composition template="template/inicial.xhtml">
	<ui:define name="corpo">
		<div class="header">
			<div class="height-1">
				<div class="table-product">
					<h:form>
						<h:panelGrid columns="2">	
							<h:outputLink value="product.jsf">Voltar</h:outputLink>
							<h:inputHidden value="null" />		
							<h:outputText value="Name: " />
							<h:inputText value="#{bbProduct.product.name}" required="true" />
							<h:outputText value="Preço: " />
							<h:inputText value="#{bbProduct.product.price}" required="true">
								<f:converter converterId="FloatConverter" />
								<f:convertNumber type="number" minFractionDigits="2" maxFractionDigits="2"/>
							</h:inputText>
							<h:outputText value="Descrição: " />
							<h:inputText value="#{bbProduct.product.description}" />
							<h:outputText value="Estoque: " />
							<h:inputText value="#{bbProduct.product.stock}" required="true">
								<f:converter converterId="IntegerConverter" />
							</h:inputText>
							<h:outputText value="Categoria(s): " />
								<h:selectManyCheckbox value="#{bbProduct.product.categories}" id="categories" layout="lineDirection" required="true">
									<f:selectItems id="category" value="#{bbCategory.itemsCategories}" />
										<f:converter converterId="SelectItemConveterToObject" />
								</h:selectManyCheckbox>
							<h:inputHidden value="null" />	
							<h:commandButton action="#{bbProduct.register}" value="Send" id="gravar" />
						</h:panelGrid>
					</h:form>
					<h:messages />
				</div>
			</div>
		</div>
	</ui:define>
</ui:composition>
</html>